<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="t_mail" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="gotoPage('D971B13A0AA24AB3BF29DE509CDDEE4A?'+vueparams+'')" type='primary' size="mini">回复</el-button>
      <el-button @click="gotoPage('/oa/communication/EmailForward?'+vueparams+'')" type='primary' size="mini">转发</el-button>
      <el-button @click="emailDetailedSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>删除</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 邮件明细 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="标题" prop="">
              {{t_mail.subject}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="发件人" prop="">
              {{t_mail.sender}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="时   间" prop="">
              {{t_mail.send_time}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="内容" prop="">
              {{t_mail.message}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 附件 </span>
      </div>
      <el-table :data="fujianmingxi">
        <el-table-column label="文件" prop="attach_name">
        </el-table-column>
        <el-table-column label="名称" prop="item_id">
          <template slot-scope="scope">
            <el-link @click="gotoPage('/xcapi/ProcessFile/DownloadFile.do?&fileid='+scope.row.item_id+''+vueparams+'')" type='primary'>{{scope.row.attach_name}}</el-link>
          </template>
        </el-table-column>
      </el-table>
      <el-button @click="gotoPage('/oa/communication/Receiver?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'EmailDetailed',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        t_mail: {
          subject: null,
          sender: null,
          send_time: null,
          message: null,
        },
        fujianmingxi: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/oa/communication/EmailAction/emailDetailed?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      emailDetailedSubmit(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/oa/communication/EmailAction/emailDetailedSubmit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
    },
  }
</script>
